#ifndef __UTILS_H
#define __UTILS_H

#include <fstream>
#include <vector>
#include <sstream>
#include <iostream>
#include <random>
#include <ctime>
#include <algorithm>

namespace mslite {

double getAvg(std::vector<double> vals, int removes);

int readSrcCode(const std::string filename, std::string &srcCode);

int getTotalSize(std::vector<int> shape);

int genData(std::vector<float>& data, std::vector<int> shape);

std::vector<float>&& matmul(std::vector<float> &lhs, std::vector<float> &rhs, int m, int n, int k);

std::vector<float>&& RearrangeWeightForWino(std::vector<float> &weight, std::vector<int> shape);

std::vector<float> ReorderOHWIToI4O4(const std::vector<float> &weight, std::vector<int> shape, int ogroup);

void getGAndGt(std::vector<float> G, std::vector<float> GT);

}

#endif